package com.snowleopard.findpeople.entity.publish;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import com.snowleopard.common.base.BaseEntity;

/**
 * ImageStorage.
 */
@Entity
@Table(name = "publ_image_storage")
public class ImageStorage extends BaseEntity {

    private static final long serialVersionUID = 5003243619281203549L;

    private String name;

    private byte[] picture;

    private InfoPublish infoPublish;

    public ImageStorage(final String id) {
        this.id = id;
    }

    public ImageStorage() {
        super();
    }

    @Column
    public byte[] getPicture() {
        return this.picture;
    }

    public void setPicture(final byte[] picture) {
        this.picture = picture;
    }

    @Column(name = "name", length = 50)
    public String getName() {
        return this.name;
    }

    public void setName(final String name) {
        this.name = name;
    }

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "info_publish_id")
    public InfoPublish getInfoPublish() {
        return infoPublish;
    }

    public void setInfoPublish(InfoPublish infoPublish) {
        this.infoPublish = infoPublish;
    }

}
